<include file="Common:header" />
<css file="__PUBLIC__/css/redmond/jquery-ui-1.10.0.custom.css"/>
<js file="__PUBLIC__/js/jquery-1.8.2.min.js" /> 
<js file="__PUBLIC__/js/jquery-ui-1.10.0.custom.min.js"/>
<css file="__PUBLIC__/Admin/css/addshow.css" />
<css file="__PUBLIC__/uploadify/uploadify.css" />
<js file="__PUBLIC__/uploadify/jquery.uploadify.min.js" />
<script>
    $(function() {
        //选项卡UI
        $( "#tabs" ).tabs();
        //上传UI,品牌LOGO上传
        $("#upload").uploadify({
            height        : 28,
            buttonImage   : '__PUBLIC__/uploadify/uploadButton.png',
            swf           : '__PUBLIC__/uploadify/uploadify.swf',
            uploader      : '{:U("Common/uploadBrand")}',
            formData : { 'session_id' : '<?php echo session_id();?>' },
            width         : 98,
            onUploadSuccess : function(file, data, response){
                eval("var data = " + data);
                if (data.status) {
                    var path = '__ROOT__/Uploads/BrandImgs/' + data.path;
                    var logoMsg = $('input[name=typename]').val();
                    $('#showlogo').css('display','block');
                    $('#showlogo img').attr('src', path);
                    $('#showlogo img').attr('title', logoMsg);
                    $('#showlogo img').attr('alt', logoMsg);
                    $('input[name=logo]').val(path);
                } else {
                    alert(data.msg);
                }
            } 
        });
    });
</script>
<js file="__PUBLIC__/Admin/js/addattr.js" />
</head>
<body>
	<form action="{:U('runAddBrand')}" method="post">
            <div id="tabs">
                <ul>
                    <li><a href="#tabs-1">添加商品品牌</a></li>
                </ul>
                <div id="tabs-1">
                    <table class="table2">
                        <tr>
                            <td width="75">品牌名称</td>
                            <td>
                                <input type="text" class="w200" name="typename"/> <span class="desc_n"></span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                是否热门
                            </td>
                            <td>是 <input style="vertical-align:middle;" type="radio" name="hot" value="1" >&nbsp|&nbsp <input style="vertical-align:middle;" type="radio" name="hot" value="0" checked="checked"/> 否</td>
                        </tr>
                        <tr>
                            <td>商品LOGO</td>
                            <td>
                                <input type="file" name="logo" id="upload" />
                                <div id="showlogo" style="display:none;">
                                    <img src="" width="150" title="" alt="">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>品牌信息描述</td>
                            <td>
                                <textarea name="description" class="w300 h100"></textarea>
                            </td>
                        </tr>
                    </table>
                </div>
                <div>
                    <input type="hidden" name="logo" value="" />
                    <input type="submit" class="bt1" value="添加商品品牌"/>
                    <input type="button" name="baclist" class="bt1" value="返回品牌列表"/>
                </div>
            </div>

        </form>
</body>
</html>